jQuery for Designers: Beginner's Guide - Second Edition by Natalie MacLees

jQuery for Designers: Beginner's Guide - Second Edition by Natalie MacLees

Author:Natalie MacLees
Language: eng
Format: mobi, azw3, epub
Publisher: Packt Publishing
Published: 2014-07-24T21:00:00+00:00


Now that we've got that container, we just need to access the data that's attached to it. To do that, we'll use jQuery's data() method, and we'll use cycle.API that the Cycle2 plugin has provided us:$('#carousel .cycle-slide').on('click', function(e){

e.preventDefault();

var index = $('#carousel .cycle-slideshow').data('cycle.API');

});

The cycle.API is just a programmer-speak for some handy bits of information that the Cycle2 plugin makes available to us. This is also the information that Cycle2 and the Cycle2 plugins themselves use to make the magic happen. You can take a look at the assorted information available to us by looking at the Cycle2 API documentation page at http://jquery.malsup.com/cycle2/api/advanced.php

Now, chances are that there's going to be a lot of information there that you don't understand—that's okay. We'll just need to understand some of it to get the functionality we want.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.